package com.example.designmode.observer;

/**
 * 观察者具体的实现方法
 */
public class ObserverServiceImpl implements ObserverService{

    private String name;
    private String message;
    private ObserverClient client;

    public ObserverServiceImpl(String name){
        this.name = name;
    }

    @Override
    public void Update(String str) {
        this.message = str;
        read();
    }

    private void read(){
        System.out.println(name + "接收到推送的消息" + message);
    }
}
